package practice.annotaion.spring;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import practice.annotaion.spring.entrance.HomeController;
import practice.annotaion.spring.entrance.InfraredRaySensor;

public class EntranceAcquisition {
	public  static  void main(String[]  args)  {
		
		String[]  configLocations = new  String[]  {  "practice/annotaion/spring/Entrance.xml"  };
		AbstractApplicationContext context = new ClassPathXmlApplicationContext(configLocations);
		context.registerShutdownHook();
		HomeController homeControl = context.getBean("homeController", HomeController.class);
		
		homeControl.checkSensorAndAlarm();
		InfraredRaySensor doorSensor = context.getBean("doorSensor", InfraredRaySensor.class);
		doorSensor.foundObject();
		homeControl.showCameraImage();
		homeControl.checkSensorAndAlarm();
	
	}
}
